package cn.exrick.xboot.base.entity

import cn.exrick.xboot.core.base.XbootBaseEntity
import cn.exrick.xboot.core.base.XbootBaseEntityKt
import cn.exrick.xboot.core.common.utils.SnowFlakeUtil
import com.baomidou.mybatisplus.annotation.TableId
import com.baomidou.mybatisplus.annotation.TableName
import com.fasterxml.jackson.annotation.JsonFormat
import io.swagger.annotations.Api
import io.swagger.annotations.ApiModel
import io.swagger.annotations.ApiModelProperty
import lombok.Data
import org.hibernate.annotations.DynamicInsert
import org.hibernate.annotations.DynamicUpdate
import org.springframework.format.annotation.DateTimeFormat
import java.util.*
import javax.persistence.Entity
import javax.persistence.Id
import javax.persistence.Table

/**
 * @author Fei
 */
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "se_security_advisor_service_enterprise")
@TableName("se_security_advisor_service_enterprise")
@ApiModel(value = "安全顾问服务过的企业")
data class SecurityAdvisorServiceEnterprise(

        @ApiModelProperty("企业id")
        var enterpriseUserId:String? = null,

        @ApiModelProperty("开始服务时间")
        @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
        @DateTimeFormat(pattern = "yyyy-MM-dd")
        var serviceBeginTime: Date? = Date(),

        @ApiModelProperty("结束服务时间")
        @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
        @DateTimeFormat(pattern = "yyyy-MM-dd")
        var serviceEndTime: Date? = null,

        @ApiModelProperty("是否正在服务")
        var serviceStatus: Boolean? = true,

        @ApiModelProperty("离职原因")
        var leaveReason: String? = null

): XbootBaseEntityKt() {

    @Id
    @TableId
    override var id: String = SnowFlakeUtil.nextId().toString()

    companion object {
        private const val serialVersionUID = 1L
    }
}